//
//@File    :	11.17_stonewt.cpp
//@Time    :	2021/08/31 21:24:21
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	Stonewt methods
//

#include <iostream>
using std::cout;
#include "11.16_stonewt.h"

//constructor Stonewt object from double value
Stonewt::Stonewt(double lbs)
{
    stone=int(lbs)/Lbs_per_stn;//integer division
    pds_left=int(lbs)%Lbs_per_stn+lbs-int(lbs);
    pounds=lbs;
}
//constructor Stonewt object from stone,double values
Stonewt::Stonewt(int stn,double lbs)
{
    stone=stn;
    pds_left=lbs;
    pounds = stn*Lbs_per_stn+lbs;
}
Stonewt::Stonewt()//default constructor,wt=0
{
    stone=pounds=pds_left=0;
}
Stonewt::~Stonewt()
{
}
//show weight in stones
void Stonewt::show_stn() const
{
    cout<<stone<<" stone, "<<pds_left<<" pounds\n";
}

//show  weight in pounds
void Stonewt::show_lbs() const 
{
    cout<<pounds<<" ppounds\n";
}